package com.neuedu.web.controller.system;

import java.util.List;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.neuedu.common.annotation.Log;
import com.neuedu.common.core.controller.BaseController;
import com.neuedu.common.core.domain.AjaxResult;
import com.neuedu.common.enums.BusinessType;
import com.neuedu.system.domain.AAAYunongLandLease;
import com.neuedu.system.service.IAAAYunongLandLeaseService;
import com.neuedu.common.utils.poi.ExcelUtil;
import com.neuedu.common.core.page.TableDataInfo;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

/**
 * 招商引资Controller
 *
 * @author ruoyi
 * @date 2024-12-16
 */
@RestController
@RequestMapping("/system/AAAlease")
@Tag(name = "【招商引资】管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class AAAYunongLandLeaseController extends BaseController
{
    private final IAAAYunongLandLeaseService aAAYunongLandLeaseService;

    /**
     * 查询招商引资列表
     */
    @Operation(summary = "查询招商引资列表")
    @PreAuthorize("@ss.hasPermi('system:AAAlease:list')")
    @GetMapping("/list")
    public TableDataInfo list(AAAYunongLandLease aAAYunongLandLease)
    {
        startPage();
        List<AAAYunongLandLease> list = aAAYunongLandLeaseService.selectAAAYunongLandLeaseList(aAAYunongLandLease);
        return getDataTable(list);
    }

    /**
     * 导出招商引资列表
     */
    @Operation(summary = "导出招商引资列表")
    @PreAuthorize("@ss.hasPermi('system:AAAlease:export')")
    @Log(title = "招商引资", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, AAAYunongLandLease aAAYunongLandLease)
    {
        List<AAAYunongLandLease> list = aAAYunongLandLeaseService.selectAAAYunongLandLeaseList(aAAYunongLandLease);
        ExcelUtil<AAAYunongLandLease> util = new ExcelUtil<AAAYunongLandLease>(AAAYunongLandLease.class);
        util.exportExcel(response, list, "招商引资数据");
    }

    /**
     * 获取招商引资详细信息
     */
    @Operation(summary = "获取招商引资详细信息")
    @PreAuthorize("@ss.hasPermi('system:AAAlease:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(aAAYunongLandLeaseService.selectAAAYunongLandLeaseById(id));
    }

    /**
     * 新增招商引资
     */
    @Operation(summary = "新增招商引资")
    @PreAuthorize("@ss.hasPermi('system:AAAlease:add')")
    @Log(title = "招商引资", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AAAYunongLandLease aAAYunongLandLease)
    {
        return toAjax(aAAYunongLandLeaseService.insertAAAYunongLandLease(aAAYunongLandLease));
    }

    /**
     * 修改招商引资
     */
    @Operation(summary = "修改招商引资")
    @PreAuthorize("@ss.hasPermi('system:AAAlease:edit')")
    @Log(title = "招商引资", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AAAYunongLandLease aAAYunongLandLease)
    {
        return toAjax(aAAYunongLandLeaseService.updateAAAYunongLandLease(aAAYunongLandLease));
    }

    /**
     * 删除招商引资
     */
    @Operation(summary = "删除招商引资")
    @PreAuthorize("@ss.hasPermi('system:AAAlease:remove')")
    @Log(title = "招商引资", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable( name = "ids" ) Long[] ids)
    {
        return toAjax(aAAYunongLandLeaseService.deleteAAAYunongLandLeaseByIds(ids));
    }
}
